function initPositionControl(e){var s=JSON.parse(e.data);if(s){window["pos_parameter_"+e.propertyID]=new PositionParameterControl(s,e)}}function PositionParameterControl(e,s){var t=BX.util.getRandomString(5);this.params=s||{};this.positions=e.positions||{};this.parentClassName=e.className?" "+e.className:"";this.selected=this.params.oInput.value||this.params.propertyParams.DEFAULT;this.id="pos_params_container_"+this.params.propertyID+"_"+t;BX.loadCSS(this.getPath()+"/style.css?"+t);this.buildNodes();this.saveData()}PositionParameterControl.prototype={getPath:function(){var e=this.params.propertyParams.JS_FILE.split("/");e.pop();return e.join("/")},buildNodes:function(){var e=[];for(var s in this.positions){if(this.positions.hasOwnProperty(s)){e.push(BX.create("DIV",{attrs:{"data-value":this.positions[s]},props:{className:"bx-pos-parameter bx-pos-parameter-"+this.positions[s]+(this.positions[s]==this.selected?" selected":"")},events:{click:BX.proxy(this.selectPosition,this)}}))}}this.params.oCont.appendChild(BX.create("DIV",{props:{className:"bx-pos-parameter-container"+this.parentClassName},children:[BX.create("DIV",{children:e,props:{className:"bx-pos-parameter-block"}}),BX.create("DIV",{props:{className:"bx-pos-parameter-decore"}}),BX.create("DIV",{props:{className:"bx-pos-parameter-decore"}}),BX.create("DIV",{props:{className:"bx-pos-parameter-decore"}}),BX.create("DIV",{props:{className:"bx-pos-parameter-decore"}}),BX.create("DIV",{props:{className:"bx-pos-parameter-decore"}})]}))},selectPosition:function(e){var s=BX.getEventTarget(e),t=this.params.oCont.querySelectorAll(".bx-pos-parameter"),a=s.getAttribute("data-value");if(this.selected==a)return;this.selected=a;for(var r in t){if(t.hasOwnProperty(r)){if(t[r].getAttribute("data-value")==this.selected){BX.addClass(t[r],"selected")}else{BX.removeClass(t[r],"selected")}}}this.saveData()},saveData:function(){this.params.oInput.value=this.selected}};
//# sourceMappingURL=script.map.js